﻿#region Using
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
#endregion

namespace ghrb.States
{
    /// <summary>
    /// Main Menu State
    /// </summary>
    class StateMainMenu : State
    {
        #region Public Functions
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="parent">Parent</param>
        public StateMainMenu(Game1 parent)
            : base(parent)
        {

        }

        /// <summary>
        /// Load content for the main menu
        /// </summary>
        /// <param name="content">ContentManager</param>
        public override void LoadContent(ContentManager content)
        {
            //Load main menu background texture
            m_texBack = content.Load<Texture2D>("Textures/Menus/MainMenu_Back");
        }

        /// <summary>
        /// Update the main menu
        /// </summary>
        /// <param name="gameTime">Game time</param>
        public override void Update(GameTime gameTime)
        {

        }

        /// <summary>
        /// Draw the main menu
        /// </summary>
        public override void Draw()
        {
            //Info of string
            string text = "Press Start to Play";
            Vector2 pos = new Vector2((m_Parent.GraphicsDevice.Viewport.Width / 2) - (m_Parent.FSP.MeasureString(text).X / 2), m_Parent.GraphicsDevice.Viewport.Height - 200);

            //Draw background
            m_Parent.SpriteBatch.Begin();
            m_Parent.SpriteBatch.Draw(m_texBack, new Rectangle(0, 0, m_Parent.GraphicsDevice.Viewport.Width, m_Parent.GraphicsDevice.Viewport.Height), Color.White);
            m_Parent.SpriteBatch.DrawString(m_Parent.FSP, text, pos, Color.RoyalBlue);
            m_Parent.SpriteBatch.End();
        }
        #endregion

        #region Properties and Vars
        /// <summary>
        /// Background texture of the MainMenu
        /// </summary>
        private Texture2D m_texBack = null;
        #endregion
    }
}
